﻿@using Microsoft.AspNet.Identity
@{
    var returnUrl = Request.QueryString["returnUrl"] ?? Request.RawUrl;
}
@if (Request.IsAuthenticated)
{
    using (Html.BeginForm("LogOff", "Account", new { area = "User", returnUrl = Request.RawUrl }, FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" }))
    {
        @Html.AntiForgeryToken()

        <ul class="nav navbar-nav navbar-right">
            <li>
                @Html.ActionLink("你好 " + User.Identity.GetUserName() + "!", "ModifyUserBasicData", "Account", routeValues: new { area = "User" }, htmlAttributes: new { title = "管理" })
            </li>
            <li><a href="javascript:document.getElementById('logoutForm').submit()">注销</a></li>
        </ul>
    }
}
else
{
    <ul class="nav navbar-nav navbar-right">
        <li>
            @*@Html.ActionLink("<i class='glyphicon glyphicon-registration-mark'></i> " +"注册", "Register", "Account", routeValues: new { area = "User", returnUrl = Request.QueryString["returnUrl"] ?? Request.RawUrl }, htmlAttributes: new { id = "registerLink" })*@
            <a href="/User/Account/Register?returnUrl=@returnUrl" id="registerLink"><i class='glyphicon glyphicon-registration-mark'></i> 注册</a>
        </li>
        <li>
            @*@Html.ActionLink(Html.Raw("<i class='glyphicon glyphicon-log-in'></i> ") +"登录","Login", "Account", routeValues: new { area = "User", returnUrl = Request.QueryString["returnUrl"] ?? Request.RawUrl }, htmlAttributes: new { id = "loginLink" })*@
            <a href="/User/Account/Login?returnUrl=@returnUrl" id="loginLink"><i class='glyphicon glyphicon-log-in'></i> 登录</a>
        </li>
    </ul>
}